using System;
using System.Collections.Generic;
using System.Text;
using CPGVertragsverwaltung.SecurityController;
using Infragistics.Win.UltraWinStatusBar;

namespace CPGVertragsverwaltung
{
    public static class GlobalVariables
    {
        //Filenames
        public static String ApplicationConfigFile;
        public static String UserConfigFile;
        public static String AttachmentDirectory;
        
        //Active Directory SIDs
        public static String ADAdminGroupSID;
        public static String ADUserGroupSID;

        //Database
        public static String DBProviderString;

        //Session Variable
        public static bool UserIsAdmin = false;

        public static void initialiseVariables()
        {
            GlobalVariables.ApplicationConfigFile = "ApplicationConfig.xml";
            GlobalVariables.UserConfigFile = "UserConfig.xml";
            GlobalVariables.AttachmentDirectory = @"H:\Vertragsverwaltung\";

            GlobalVariables.ADUserGroupSID = ADServices.getSIDFromName("App_Vertragsverwaltung");
            GlobalVariables.ADAdminGroupSID = ADServices.getSIDFromName("App_Vertragsverwaltung_Admin");
            GlobalVariables.UserIsAdmin = ADServices.isUserAdmin();

            GlobalVariables.DBProviderString = "Provider=SQLOLEDB.1;Password=dbverw;Persist Security Info=True;User ID=dbverw;Initial Catalog=vertragsverwaltung;Data Source=S01072";
        }
    }
    public static class StatusPanels
    {
        public static UltraStatusPanel Action;
        public static ProgressBarInfo Progress;
        public static UltraStatusPanel Security;
    }
}
